home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Best of Shareware
/
Best of PC Windows Shareware 1.0 - Wayzata Technology (7111) (1993).iso
/
mac
/
ZIPPED
/
DOS
/
GRAPHICS
/
LISS151.ZIP
/
LISSAJOU.DOC
next >
Wrap
Text File
|
1992-04-21
|
11KB
|
301 lines
Lissajous V1.51
April 21, 1992
By Aaron Caba and Dan Farmer
Disclaimer:
This program is worth every cent that you payed for it! If
something breaks when you use this, I'll refund 100% of your
payment. Other than that, I will not be held responsible if
Lissajous causes any damage to your system.
=================================================================
Description:
Lissajous generates 3-D Lissajous patterns for output into ray-
tracing format. A Lissajous pattern is a periodic pattern
gennerated using sines and cosines as a function of time. (Got
that? Didn't think so) If you want to know how it works and
maybe gain some insight as to why the patterns turned out the way
they did, see the 'How it Works' section near the end of this
document.
The following output formats are supported:
* Vivid ray tracer (Ver. 1.0, Copyright 1989-1992 Stephen B.
Coy)
* Persistence of Vision (PoV) ray tracer, Versions 0.5ß and
1.0 (Copyright (c) 1992 POV-Team)
* Connect the Dots Smoother (CTDS) (Ver. 1.6: Copyright (C)
1992 By Truman Brown.
* Raw format: just the (x,y,z) coordinates of the points.
=================================================================
How to use Lissajous:
There are 2 main parts to Lissajous, the Editing/Viewing screen,
and the Data File Output screen. The E/V screen is where you
edit the parameters and view the figure generated by those
parameters. On the Data File Output screen, you can choose the
output file format.
=================================================================
Edit/Viewing screen:
The editing/viewing screen is the first thing you see when you
start the program. The generation parameters are in the left
window, the viewing window is the empty window, and on the bottom
is the message window. The equations used to generate the figure
will be listed in the left window also. (This should be pretty
obvious when you use the program)
Note: Lissajous uses a RIGHT handed coord system. On the
viewing screen, the axis you don't see is pointing OUT of
the screen.
Here's a quick description of each generation parameter:
-- R Value:
An positive integer that controls the over all size of the
generated figure. If R is set to 100, no coordinate will be
greater than +/-100.
-- A Value:
One of the variables that affects generation: It changes
the period of the equations, changing the figure. It must
be a positive decimal number.
-- B Value:
Like the A variable, but it is used in different places in
the equations.
-- X, Y, Z-Exponent:
These are exponents in the generation functions. They apply
to the x, y, and z coordinate equations respectively.
Positive integers from 1 to 9.
-- Sphere Rad:
This controls the size of the spheres that make-up the
figure. Positive ints from 1 to 99.
-- # of Spheres:
Use this to say how many spheres/dots you want in the
generated figure. The more spheres you have, the smoother
it looks, but at the expense of a longer tracing time.
-- View (X,Y,Z):
Change the viewing perspective to the x, y, or z axis. Use
this to get a good look at what you have created.
-- Method (1-5):
To choose which set of generating functions to use. See
'How it Works'.
To create a figure, edit the parameters to something promising,
and either hit PageDown, or use the arrow keys to go past the
last parameter.
Note: The PageUp key will take you to the top of the
list.
Hints:
To create good looking pictures, it is advisable (but not
necessary) to have A and B be multiples of some common factor, or
be a simple ratio such as 4:5, 1:3, etc. Also, the picture
doesn't depend on what A and B are explicitly, only on the ratio
A/B (except for algorithm 4, I think). So, if the dots don't
seem to be very spread out around the figure, try multiplying or
dividing both A and B by the same factor. (ie: if A=4 & B=5,
try A=8 & B=10 or A=2 & B=2.5) If you do this a couple of times,
the dots will spread themselves out.
Along that note, if you use the CTDS or the Smooth Vivid output
option (see Data File Output below), you can probably reduce the
number of spheres generated by a factor of 2 (maybe even 3) and
still have a relatively smooth looking figure.
Note: Generally, the closer the ratio A/B gets to 1,
the more spheres you will need to resolve the figure.
Note: Your 'viewing position' in the view window is at
+300, so if you set R to 300 or greater, weird things
will happen. Don't worry: even though the preview
looks weird, the output files will be OK.
After the spheres are drawn, the message window will display:
"Finished: [O]=Output script [R]=Rotate [CR]=More [ESC]=Quit"
-- O:
Takes you to the Data File Output screen (see below).
-- R:
This will allow you to rotate the figure. Simply input your
desired rotation at the prompt and press <enter>.
-- CR:
Also know as <Return> and <Enter>. This will take you back
to editing the data.
-- ESC:
Go figure.
=================================================================
Data File Output screen:
"Script file type: [P]oV [V]ivid [C]TDS [R]aw"
First choose what format you want the output file in: PoV, Vivid,
CTDS or Raw. After that, input a file name, up to 8 characters.
The appropriate file extension will be added on.
-- PoV:
First give what version of PoV you are using. Then you will
be asked for the number of colors to use. At the following
prompts, input either a declared color constant (eg. CRed,
Yellow, DarkOrchid, etc) or input your own RGB color values,
exactly as you would in a PoV data file.
-- Vivid:
You will have 2 options at this point: [S]mooth or [B]eaded
Smooth: This will produce CTDS style output for Vivid.
Each sphere will be connected to the two next to it with a
cylinder, to give the impression that the figure is smooth.
Beaded: This will just output the sphere definitions.
-- CTDS:
The file will be written immediately after you enter the
output file name.
-- Raw:
You have two options on the order of the 'raw' coordinates:
"Sort data on: View-[A]xis or [C]TDS style". The Z-Axis
will write the points in the same order that they are
displayed on the 'Editing and Viewing screen' ie. from
farthest to closest, on the Z component.
The CTDS style will sort the spheres in order as if you were
to trace around the figure once. (the last point in the
list will be next to the first)
The Raw format is simply a listing of the (x,y,z)
coordinates of all the generated points in the following
(ASCII) format:
-31.386734 -21.351656 -92.514755
33.689098 20.799326 -91.828278
-817.685364 -569.559448 70.666443
-35.990498 -20.077362 -91.113029
-38.279678 19.185160 -90.369217
40.545330 -18.122829 -89.597092
50.144905 11.279497 -85.780312
-52.081665 -9.315856 -84.857025
0.158359 7.953411 -998.968323
^ ^ ^ ^
│ │ │ └─ Z component
│ │ └─ Y component
│ └─ X component
└─ Left most character
Each field is 11 characters wide with 2 spaces between the
fields.
=================================================================
How to use the output files:
The PoV and Vivid files are written so they are ready to be
traced. Just plug them into their respective raytracers, and sit
and enjoy. If you don't like the default camera position,
lighting, etc., then change them. I just put those into the
program so a novice could get quick results.
When using the CTDS files, be sure to use the /c option. The /c
will connect the first and last dots, closing the figure. To let
the /m parameter do its job, it will be necessary to put breaks
after every 5th to 10th sphere (or whatever you want), so CTDS
can generate useful bounding spheres.
I don't have any use for the .RAW files right now, but Dan
suggested that I put them in, in case some other entrepreneurial
soul decides that there is a use for it. (It was easy to code
too!)
=================================================================
How it all works:
Remember using an Etch-a-Sketch? You had two knobs. One
controlled the X position of the cursor, and the other the Y
position. Now twist the X knob back and forth. The cursor will
move left and right in a straight line. Now if you twist the Y
knob at the same time, you end up with a curve on the screen. If
you were careful, you could draw a pretty good circle by turning
the knobs smoothly back and forth.
Lissajous patterns are generated in much the same fassion. I'm
going to stick to the 2-D here but the 3-D is simmalar. What
Lissajous does is move the X and Y knobs slowly back and forth
according to the built in equations (see 'How it Works'). If you
move the Y knob twice as fast as the X knob, you will generate a
figure 8.
For the 3-D, it is the same as above, but with another knob on
the Etch-a-Sketch that moves the cursor toward and away from you.
(You either need another hand, or a friend to try this one ;-) )
A 3-D Lissajous figure is created using 3 parametric equations, 1
each for the x, y, and z coordinates. These equations are
functions of sin and cos, so they are periodic, with the actual
period depending on what values you enter. The values you input
in these functions are: a, b, and exponent_x/y/z. The value of
't' is the parameter, and ranges from 0 to # of spheres-1.
Here are the coordinate functions, by algorithm number:
1)
x = r * (sin(a*t) * (cos(b*t)^exponent_x))
y = r * (sin(a*t) * (sin(b*t)^exponent_y))
z = r * (cos(a*t)^exponent_z)
2)
x = r * (sin(a*t) * (cos(b*t)^exponent_x))
y = r * (cos(a*t) * (cos(b*t)^exponent_y))
z = r * (sin(a*t)^exponent_z)
3)
x = r * (sin(a*t) * (sin(b*t)^exponent_x))
y = r * (sin(a*t) * (cos(b*t)^exponent_y))
z = r * (sin(a*t)^exponent_z);
4)
x = r/4 * (a * sin(2*(t-PI/13))^exponent_x)
y = r/4 * (-b * cos(t)^exponent_y)
z = r * (sin(a*t)^exponent_z)
5)
x = r * (sin(a*t) * (cos(a*t)^exponent_x))
y = r * (sin(b*t) * (sin(b*t)^exponent_y))
z = r * (sin(t)^exponent_z)
=================================================================
Well, that's about all I have to say. If you have any comments,
suggestions, etc., please contact me at:
Mind Image BBS: (612) 781-1720 ADEnet, CompuGFX echo
(or any ADEnet board)
10121 Laurel Drive
Eden Prairie, MN 55347
Aaron C. Caba